package com.service.impl;

import com.mapper.EchartsMapper;
import com.pojo.Echarts;
import com.service.EchartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EchartsServiceImpl implements EchartsService {

    @Autowired
    private EchartsMapper echartsMapper;

    /**
     * 封装每个美食课程的数据：1.food 2.IT 3.country 4.game 5.entertainment 6.travel
     * @return
     */
    public Echarts findCourseTypeTotals() {
        Echarts echarts = new Echarts((Integer) echartsMapper.findFoodTotals().get(0),(Integer) echartsMapper.findITTotals().get(0),
                (Integer) echartsMapper.findCountryTotals().get(0),(Integer) echartsMapper.findEntertainmentTotals().get(0),(Integer) echartsMapper.findTravelTotals().get(0));
        return echarts;
    }
}
